#ifndef __WIZ_TIMER_COUNT_DOWN_HPP__SHANHAOBO_19800429__
#define __WIZ_TIMER_COUNT_DOWN_HPP__SHANHAOBO_19800429__

#include "./WizTimer.hpp"

namespace Wiz
{
    namespace Timer
    {
        namespace CountDown
        {
            //////////////////////////////////////////////////////////////////////////
            class WIZ_EXPORT Type
            {
                ::Wiz::Real32::Type m_Start;
                ::Wiz::Real32::Type m_Duration;
            public:
                Type()
                {
                }
                ~Type(){}
            public:
                ::Wiz::Void::Type Restart()
                {
                    this->m_Start = ::Wiz::Timer::Now();
                }
                ::Wiz::Void::Type Start(::Wiz::Real32::In t)
                {
                    this->m_Duration = t;
                    this->Restart();
                }
                ::Wiz::Void::Type StartMS(::Wiz::UInt32::In t)    /// MS
                {
                    this->m_Duration = ((::Wiz::Real32::In)(t)) / ::Wiz::Timer::eMilliSecondPerSecond;
                    this->Restart();
                }
                ::Wiz::Void::Type StartUS(::Wiz::UInt32::In t)    /// US
                {
                    this->m_Duration = ((::Wiz::Real32::In)(t)) / ::Wiz::Timer::eMicroSecondPerSecond;
                    this->Restart();
                }
                ::Wiz::Void::Type StartNS(::Wiz::UInt64::In t)    /// US
                {
                    this->m_Duration = ((::Wiz::Real32::In)(t)) / ::Wiz::Timer::eNanoSecondPerSecond;
                    this->Restart();
                }
                ::Wiz::Bool::Type TimeOver()
                {
                    return ::Wiz::Nearly::Greater(::Wiz::Timer::Now(), this->m_Start + this->m_Duration);
                }
            };
            WIZ_DECLARE(::Wiz::Timer::CountDown::Type);
            //////////////////////////////////////////////////////////////////////////
        } /// end of namespace CountDownTimer
    } /// end of namespace Timer
} /// end of namespace Wiz

#endif /*__WIZ_TIMER_COUNT_DOWN_HPP__SHANHAOBO_19800429__*/
